package com.heima.user.client;

import com.heima.model.user.dtos.UserInfoDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient("leadnews-user")
public interface UserFeign {
    /**
     * 根据用户id和关注作者的id查询
     * @param userId
     * @param followId
     * @return
     */
    @GetMapping("/api/v1/user/isUserFollow")
    Boolean findByUserIdAndFollowId(@RequestParam(name = "userId") Integer userId,
                                    @RequestParam(name = "followId") Integer followId);

    /**
     * 查询用户信息
     *
     * @param id
     * @return
     */
    @GetMapping("/api/v1/user/{id}")
    UserInfoDto findUserById(@PathVariable(name="id") Integer id);
}
